from wtforms import Form
from wtforms.fields import StringField, PasswordField
from wtforms.validators import DataRequired, Email, Length, EqualTo, ValidationError


class TokenPostValidate(Form):
    code = StringField(validators=[DataRequired(message='code不能为空')])
    # email = StringField(validators=[DataRequired(message='Email不能为空'), Email()])
    # password = PasswordField(validators=[DataRequired()])
    # confirm_password = PasswordField(validators=[DataRequired(), EqualTo('password')])
    #
    # def validate_password(self, field):
    #     password = field.data
    #     if password == password.lower() or password == password.upper():
    #         raise ValidationError(u'必须同时包含大小写字母')
